<?php  
if (!isset($instance['categories'])){
	$instance['categories'] = 0;
}
extract($instance);

$default = array(
	'orderby' => $orderby,
	'order' => $order,
	'number' => $number,
	'status' => 'approve', 
	'post_status' => 'publish'
);

$list = get_comments($default);
//var_dump($list);
if (count($list) > 0){
?>
<div class="ya-comments">
	<?php foreach ($list as $comment){?>
	<div class="ya-comment">
		<div class="comment-author">
			<?php echo get_avatar($comment->user_id, '90');?>
		</div>
		<div class="comment-caption">
			<a class="sw-title" href="<?php echo get_comments_link($comment->comment_post_ID);?>"><?php echo $comment->post_title; ?></a>
			<div class="sw-content"><?php echo self::ya_trim_words($comment->comment_content, $length)?></div>
			<span class="comment-date"><?php echo date('d F Y',strtotime($comment->comment_date));?></span>
		</div>
	</div>
	<?php } ?>
</div>
<?php }?>